/**
 * info.h - Tools for looking up user info
 *
 * WoodPecker is the legal property of its developers, whose names are too numerous
 * to list here.  Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * $Id: info.h 121 2008-04-12 08:41:34Z dubkat $
 */

#ifndef _PURPLE_PECKER_PECKERINFO_H_
#define _PURPLE_PECKER_PECKERINFO_H_

#include <glib.h>

#include "pecker.h"
#include "util.h"

/**
 * Begin temporary, pending further refactoring
 */
#include "connection.h"
struct pecker_fetch_thumbnail_data
{
    PurpleConnection *gc;
    char *who;
    char *filename;
    char *bio;
    char *stats;
    // const char *pic_data;
    // gint pic_data_len;
};

void pecker_fetch_thumbnail_cb(PurpleUtilFetchUrlData * url_data, void *user_data, const gchar * pic_data, gsize len,
                               const gchar * error_message);

/**
 * End temporary, pending further refactoring
 */

/**
 * Extract the thumbnail string from the extra IRC info about the user.
 * The returned string should be freed when no longer needed.
 *
 * @param info The extra IRC info string.
 *
 * @return The thumbnail string.
 */
char *pecker_thumbnail_strdup(const char *info);

/**
 * Extract the bio string from the extra IRC info about the user.
 * The returned string should be freed when no longer needed.
 *
 * @param info The extra IRC info string.
 *
 * @return The bio string.
 */
char *pecker_bio_strdup(const char *info);



gboolean pecker_stats_find_pecker_token(const char *info);

/**
 * Extract the stats string from the extra IRC info about the user.
 * The returned string should be freed when no longer needed.
 *
 * @param info The extra IRC info string.
 *
 * @return The stats string.
 */
char *pecker_stats_strdup(const char *info);

/**
 * Process extra IRC information about a buddy
 *
 * @param pecker The protocol-specific data related to the connection.
 * @param name The buddy name
 * @param online Is the buddy on line.
 * @param info The extra IRC info string about the buddy, if any.
 * @param fetch_thumbnail Whether or not to trigger a url fetch of thumbnail photo.
 */
void pecker_buddy_status(struct pecker_conn *pecker, char *name, gboolean online, char *info, gboolean fetch_thumbnail);


void pecker_update_channel_member(struct pecker_conn *pecker, const char *nick, const char *info);
#endif /* _PURPLE_PECKER_PECKERINFO_H_ */

/**
 * vim:tabstop=4:shiftwidth=4:expandtab:
 */
